package com.aaa.dao.system;


import com.aaa.entity.system.Menu;
import com.aaa.entity.system.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 角色信息表(Role)表数据库访问层
 *
 * @author makejava
 * @since 2022-08-31 20:32:53
 */
public interface RoleDao {
    /**
     * @create by:
     * @description: 查询所有角色
     * @create time: 2022/9/6 14:52
     *  * @param null
     * @return
     */
    List<Role> queryAllRolePage(Role role);

    /**
     * @create by:
     * @description: 保存
     * @create time: 2022/9/6 14:52
     *  * @param null
     * @return
     */
    int saveRole(Role role);

    /**
     * @create by:
     * @description: 根据名字查询角色
     * @create time: 2022/9/6 14:52
     *  * @param null
     * @return
     */
    int queryRoleByName(Role role);

    /**
     * @create by:
     * @description: 修改
     * @create time: 2022/9/6 14:52
     *  * @param null
     * @return
     */
    int updateRole(Role role);

    /**
     * @create by:
     * @description: 删除角色
     * @create time: 2022/9/7 14:26
     *  * @param null
    * @return
    */
    int deleteRole(String id);
    /**
     * @create by:
     * @description: 根据ID删除
     * @create time: 2022/9/7 14:26
     *  * @param null
   * @return
    */
    int deleteByRoleId(Integer roleId);
    /**
     * @create by:
     * @description: 查询所有菜单
     * @create time: 2022/9/7 14:26
     *  * @param null
    * @return
    */
    List<Menu> queryAllMenu();
    /**
     * @create by:
     * @description: 汪role_menu中插入数据
     * @create time: 2022/9/7 14:26
     *  * @param null
    * @return
    */
    int insertRoleMenu(@Param("roleId") int roleId, @Param("menuId") String menuId);
    /**
     * @create by:
     * @description: 从role_menu删除
     * @create time: 2022/9/7 14:27
     *  * @param null
    * @return
    */
    int deleteRoleMenuById(int roleId);
    /**
     * @create by:
     * @description: 查询选中的
     * @create time: 2022/9/7 14:27
     *  * @param null
    * @return
    */
    List<Integer> findSelectMenu(int roleId);
    /**
     * @create by:
     * @description: 检测关键字是否重复
     * @create time: 2022/9/7 14:27
     *  * @param null
    * @return
    */
    int queryRoleKey(Role role);

    /**
     * @create by:
     * @description: 查询角色名
     * @create time: 2022/9/7 14:27
     *  * @param null
    * @return
    */
    int findRoleName(Role role);

    /**
     * @create by:
     * @description: 删除
     * @create time: 2022/9/6 14:53
     *  * @param null
     * @return
     */
    int deleteRole(Integer id);

    /**
     * 通过ID查询单条数据
     *
     * @param roleId 主键
     * @return 实例对象
     */
    Role queryById(Integer roleId);

    /**
     * 获取全部角色
     * @return List<Role>
     */
    List<Role> queryAllRole();
}

